<%--
  Created by IntelliJ IDEA.
  User: zhouzixiong1
  Date: 2017/8/30
  Time: 15:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户登录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="../../statics/css/bootstrap.min.css" rel="stylesheet">
    <link href="../../statics/css/style.css" rel="stylesheet">
    <link href="../../statics/css/Alogin.css" rel="stylesheet">
    <link href="../../statics/css/ATopMenu.css" rel="stylesheet">
    <script src="../../statics/js/jquery-3.0.0.js"></script>
    <script src="../../statics/js/layer.js"></script>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="title aTopMenu">用户登录</div>
    </div>
    <div class="row">
        <div class="col-sm-8 col-sm-push-2">
            <div class="col-sm-4 label">用户名：</div>
            <div class="col-sm-8">
                <input class="form-control" name="userName" id="userName" placeholder="请输入用户名"/>
            </div>
            <div class="col-sm-4 label">密&nbsp;码：</div>
            <div class="col-sm-8">
                <input class="form-control" name="password" id="password" placeholder="请输入密码"/>
            </div>
            <%--<div class="col-sm-4 label">验证码：</div>--%>
            <%--<div class="col-sm-8">--%>
                <%--<input class="form-control" name="check" id="check" placeholder="请输入验证码"/>--%>
            <%--</div>--%>
            <button class="btn btn-info" name="login" id="login" onclick="login()"/>
        </div>
    </div>
</div>

<script type="text/javascript">
    function login() {
        var login = {
            userName: $("#userName").val(),
            password: $("#password").val()
        };
        $.ajax({
            type:'post',
            url:'/NormalUser/normalUserLogin',
            data: JSON.stringify(login),
            contentType: 'application/json',
            dataType:'json',
            success: function (data) {
                if(data.code!="0"){
                    layer.msg(data.message);
                }else{
                    layer.msg("注册成功，正在跳转");
                }

            }
        });
    }
</script>

</body>
</html>
